<?php
// +----------------------------------------------------------------------
// | EasyAdmin
// +----------------------------------------------------------------------
// | PHP交流群: 763822524
// +----------------------------------------------------------------------
// | 开源协议  https://mit-license.org 
// +----------------------------------------------------------------------
// | github开源项目：https://github.com/zhongshaofa/EasyAdmin
// +----------------------------------------------------------------------
namespace app\model\api;

use laytp\BaseModel;
use think\model\concern\SoftDelete;

class YysJx extends BaseModel
{
    protected $name = 'yys_jx';



    /**
     * 角色觉醒详情
     * @param $role_id
     * @return array
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function detail($role_id){
        $info = $this->where('role_id','=',$role_id)
            ->field('headimg_jx1,headimg_jx2,jx_type,jx_description,material')
            ->cache(true)->find()->toArray();

        if(empty($info)){
            return [];
        }
        $info['material'] = json_decode($info['material'],true);
        return $info;

    }
}